<template>
  <t-dialog :header="`${header}-专家详情`" :visible.sync="visible" :onClose="closeDialog" :closeOnOverlayClick="false"
    :confirmBtn="null" width="80%" top="5%">
    <div style="height: 65vh">
      <t-sticky-tool :style="{ position: 'absolute', overflow: 'hidden', zIndex: 1000 }" :offset="[-30, 80]"
        @click="handleExport">
        <t-sticky-item style="width: 100px" label="导出评审记录">
          <template #icon>
            <t-icon name="file"></t-icon>
          </template>
        </t-sticky-item>
      </t-sticky-tool>
      <!--      <t-tabs  v-model="tabValue">-->
      <!--        <t-tab-panel class="tab-panel" value="0" label="基本信息">-->
      <t-divider style="font-size: 20px">基本信息</t-divider>
      <t-form ref="form" class="step-form" :data="formData" labelWidth="0px">
        <t-row>
          <t-col :span="2" class="title">头像：</t-col>
          <t-col :span="4">
            <t-avatar v-if="formData.sysUser.avatar" size="100px" :image="formData.sysUser.avatar">
            </t-avatar>
            <t-avatar v-else size="100px">
              {{ formData.sysUser.nickName }}
            </t-avatar>
          </t-col>
          <t-col :span="2" class="title">电子签名：</t-col>
          <t-col :span="4">
            <div v-if="signatureFiles.length > 0">
              <img :src="signatureFiles[0].url" width="150" height="70" style="border: 2px dashed #d3d3d3;" />
            </div>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span>专家姓名：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.nickName">
              {{ formData.sysUser.nickName }}<span v-if="formData.isInviteExpert === '1'" style="color: red">(邀)</span>
              <!--                <t-input clearable placeholder="请输入专家姓名" v-model="formData.sysUser.nickName"></t-input>-->
            </t-form-item>
          </t-col>
          <t-col :span="2" class="title"><span class="require">*</span> 性别：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.sex">
              {{ formData.sysUser.sex | filterByDict(dict.type.sys_user_sex) }}
              <!--                <t-radio-group v-model="formData.sysUser.sex" :options="dict.type.sys_user_sex"></t-radio-group>-->
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span>身份证号：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.idCard">
              {{ formData.sysUser.idCard }}
              <!--                <t-input clearable placeholder="请输入身份证号码" v-model="formData.sysUser.idCard"  :maxlength="18" show-limit-number />-->
            </t-form-item>
          </t-col>
          <t-col :span="2" class="title"><span class="require">*</span>出生年月：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.birthDate">
              {{ formData.sysUser.birthDate }}
              <!--                <t-date-picker disabled v-model="formData.sysUser.birthDate"></t-date-picker>-->
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span>民族：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.national">
              {{ formData.sysUser.national | filterByDict(dict.type.national) }}
              <!--                <t-select v-model="formData.sysUser.national" clearable placeholder="请选择民族" :options="dict.type.national">-->
              <!--                </t-select>-->
            </t-form-item>
          </t-col>
          <t-col :span="2" class="title"><span class="require">*</span>政治面貌：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.politicsStatus">
              {{ formData.sysUser.politicsStatus | filterByDict(dict.type.politics_status) }}

              <!--                <t-select v-model="formData.sysUser.politicsStatus" clearable placeholder="请选择政治面貌" :options="dict.type.politics_status">-->
              <!--                </t-select>-->
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span><t-tooltip content="选择的组别越靠前，推荐优先度越高，限制选两个">
              <t-icon name="help-circle-filled"></t-icon>
            </t-tooltip>组别：</t-col>
          <t-col :span="4">
            <t-form-item name="recommendMajor">
              <t-select readonly :max="2" v-model="formData.recommendMajor" :keys="{ keys: { value: 'id' } }"
                :options="dict.type.recommend_major" placeholder="添加组别" multiple />
            </t-form-item>
          </t-col>
          <t-col :span="2" class="title">电子信箱：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.email">
              {{ formData.sysUser.email }}
              <!--                <t-input clearable placeholder="请输入电子信箱" v-model="formData.sysUser.email"></t-input>-->
            </t-form-item>
          </t-col>

        </t-row>
        <t-row>
          <t-col :span="2" class="title">通讯地址：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.contactAds">
              {{ formData.sysUser.contactAds }}
              <!--                <t-input clearable placeholder="请输入通讯地址" v-model="formData.sysUser.contactAds"></t-input>-->
            </t-form-item>
          </t-col>
          <t-col :span="2" class="title">邮政编码：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.postcode">
              {{ formData.sysUser.postcode }}
              <!--                <t-input clearable placeholder="请输入邮政编码" v-model="formData.sysUser.postcode"></t-input>-->
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span>手机号码：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.phonenumber">
              {{ formData.sysUser.phonenumber }}
              <!--                <t-input clearable placeholder="请输入手机号码" v-model="formData.sysUser.phonenumber"></t-input>-->
            </t-form-item>
          </t-col>
          <t-col :span="2" class="title"><span class="require">*</span>单位名称：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.departmentId">

              {{ formData.sysUser.departmentId | filterByTree(deptOptions) }}
              <!--                <t-tree-select clearable filterable :treeProps="{keys: {value: 'id'}}" v-model="formData.sysUser.departmentId"-->
              <!--                               :data="deptOptions" placeholder="选择单位"></t-tree-select>-->
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span>单位性质：</t-col>
          <t-col :span="10">
            <t-form-item name="coNature">
              <t-radio-group :disabled="true" v-model="formData.coNature"
                :options="dict.type.co_nature"></t-radio-group>
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span>单位所在地：</t-col>
          <t-col :span="4">
            <t-form-item name="coAddress">
              {{ formData.coAddress | filterParentsByTree(locationOptions) }}
            </t-form-item>
          </t-col>
          <t-col :span="2" class="title"><span class="require">*</span>职务：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.duty">
              {{ formData.sysUser.duty }}
              <!--                <t-input clearable placeholder="请输入职务" v-model="formData.sysUser.duty"></t-input>-->
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span>技术职称：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.profTitId">
              {{ formData.sysUser.profTitId | filterByTree(profTitOptions, children = "children", id = "id", label =
              "name")
              }}

              <!--                <t-tree-select clearable @change="onProfTitIdChange" filterable style="width: 390px" :treeProps="{keys: {value: 'id',label:'name'}, valueMode: 'onlyLeaf'}"-->
              <!--                               v-model="formData.sysUser.profTitId" :data="profTitOptions"-->
              <!--                               placeholder="请选择技术职称"></t-tree-select>-->
            </t-form-item>
          </t-col>
          <t-col :span="2" class="title"><span class="require">*</span>职称级别：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.profTit">
              {{ formData.sysUser.profTit | filterByDict(dict.type.prof_tit) }}
              <!--                <t-select disabled v-model="formData.sysUser.profTit" clearable placeholder="请选择职称级别" :options="dict.type.prof_tit">-->
              <!--                </t-select>-->
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span>最高学历：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.education">
              {{ formData.sysUser.education | filterByDict(dict.type.education) }}

              <!--                <t-select v-model="formData.sysUser.education" clearable placeholder="请选择学历" :options="dict.type.education">-->
              <!--                </t-select>-->
            </t-form-item>
          </t-col>
          <t-col :span="2" class="title"><span class="require">*</span>最后学位：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.degree">
              {{ formData.sysUser.degree | filterByDict(dict.type.degree) }}
              <!--                <t-select v-model="formData.sysUser.degree" clearable placeholder="请选择学位" :options="dict.type.degree" />-->
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span>所学专业：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.majorName">
              {{ formData.sysUser.majorName }}
            </t-form-item>
          </t-col>
          <t-col :span="2" class="title"><span class="require">*</span>现从事专业：</t-col>
          <t-col :span="4">
            <t-form-item name="sysUser.majorNowName">
              {{ formData.sysUser.majorNowName }}
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title">办公电话：</t-col>
          <t-col :span="4">
            <t-form-item name="telephone">
              {{ formData.telephone }}
              <!--                <t-input clearable placeholder="请输入办公电话" v-model="formData.telephone"></t-input>-->
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title">专家荣誉：</t-col>
          <t-col :span="10" style="display: flex;flex-direction: column">
            <t-form-item name="expertHonorary">
              <t-checkbox-group :disabled="true" v-model="formData.expertHonorary" style="flex-direction: column"
                :options="dict.type.expert_honorary" />
            </t-form-item>
            <t-textarea :readonly="true" v-if="formData?.expertHonorary?.includes('99')"
              v-model="formData.otherExpertHonorary" :autosize="{ minRows: 3 }" placeholder="请输入其他荣誉" />
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title">主要业绩：</t-col>
          <t-col :span="10">
            {{ formData.performance }}
            <!--              <t-textarea   :autosize="{minRows: 3}" clearable placeholder="请输入主要业绩" v-model="formData.performance" />-->
          </t-col>
        </t-row>
        <div class="form_item_title">银行信息</div>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span>开户银行名称(请精确到支行)：</t-col>
          <t-col :span="4">
            <t-form-item name="expertBank.bankName">
              {{ formData.expertBank.bankName }}
            </t-form-item>
          </t-col>
          <t-col :span="2" class="title"><span class="require">*</span>开户户名：</t-col>
          <t-col :span="4">
            <t-form-item name="expertBank.bankUsername">
              {{ formData.expertBank.bankUsername }}
            </t-form-item>
          </t-col>
        </t-row>
        <t-row>
          <t-col :span="2" class="title"><span class="require">*</span>开户账号：</t-col>
          <t-col :span="4">
            <t-form-item name="expertBank.accountName">
              {{ formData.expertBank.accountName }}
            </t-form-item>
          </t-col>
        </t-row>
      </t-form>
      <!--        </t-tab-panel>-->
      <t-divider style="font-size: 20px">个人简介</t-divider>

      <!--        <t-tab-panel class="tab-panel" value="2" label="个人简介">-->
      <expert-about :editOpen="false" :objId="objId"></expert-about>
      <!--        </t-tab-panel>-->
      <t-divider style="font-size: 20px">参与项目</t-divider>
      <t-tabs v-model="tabValue">
        <t-tab-panel v-for="(tab, tabIndex) in tabList" :key="tabIndex" :value="tab.value">
          <template #label>
            {{ tab.label }}
            <t-badge style="position: relative" :count="tab.count" show-zero :offset="[-6, 0]"></t-badge>
          </template>
          <div v-if="tab.value === '0'">
            <kjxm-list :idCard="idCard"></kjxm-list>
          </div>
          <div v-if="tab.value === '1'">
            <bzh-list :idCard="idCard"></bzh-list>
          </div>
          <div v-if="tab.value === '2'">
            <kjsf-list :idCard="idCard"></kjsf-list>
          </div>
          <div v-if="tab.value === '3'">
            <wcx-list :idCard="idCard"></wcx-list>
          </div>
        </t-tab-panel>
      </t-tabs>
      <t-divider style="font-size: 20px">研究成果</t-divider>
      <t-tabs v-model="tabValue2">
        <t-tab-panel v-for="(tab, tabIndex) in resultTabList" :key="tabIndex" :value="tab.value">
          <template #label>
            {{ tab.label }}
            <t-badge style="position: relative" :count="tab.count" show-zero :offset="[-6, 0]"></t-badge>
          </template>
          <div v-if="tab.value === '0'">
            <thesis-list :idCard="idCard"></thesis-list>
          </div>
          <div v-if="tab.value === '1'">
            <treatise-list :idCard="idCard"></treatise-list>
          </div>
          <div v-if="tab.value === '2'">
            <patent-list :idCard="idCard"></patent-list>
          </div>
          <div v-if="tab.value === '3'">
            <copyright-list :idCard="idCard"></copyright-list>
          </div>
          <div v-if="tab.value === '4'">
            <awards-list :idCard="idCard"></awards-list>
          </div>
          <div v-if="tab.value === '7'">
            <gf-list :idCard="idCard"></gf-list>
          </div>
          <div v-if="tab.value === '8'">
            <other-list :idCard="idCard"></other-list>
          </div>
        </t-tab-panel>
      </t-tabs>

    </div>
  </t-dialog>
</template>

<script>
import expertAbout from "../expert-about.vue";
import { getFiles } from "@/api/common";
import kjxmList from "../../../common/system/components/kjxm-list.vue";
import bzhList from "../../../common/system/components/bzh-list.vue";
import kjsfList from "../../../common/system/components/kjsf-list.vue";
import wcxList from "../../../common/system/components/wcx-list.vue";
import thesisList from "../../../common/system/components/thesis-list.vue";
import TreatiseList from "../../../common/system/components/treatise-list.vue";
import patentList from "../../../common/system/components/patent-list.vue";
import CopyrightList from "../../../common/system/components/copyright-list.vue";
import AwardsList from "../../../common/system/components/awards-list.vue";
import GfList from "../../../common/system/components/gf-list.vue";
import OtherList from "../../../common/system/components/other-list.vue";

export default {
  name: "patent-detail-dialog",
  dicts: ["sys_user_sex", "national", "classification", "prof_tit", "education", "degree", "co_nature", "io_province", "expert_expertise", "expert_honorary", "expert_category", "expert_subclass", "recommend_major", "politics_status"],
  components: {
    expertAbout,
    OtherList,
    GfList,
    AwardsList,
    CopyrightList,
    TreatiseList,
    kjxmList,
    bzhList,
    kjsfList,
    wcxList,
    thesisList,
    patentList
  },
  props: {
    objId: [String, Number],
    idCard: [String, Number],
    header: String,
  },
  data () {
    return {
      tabList: [
        { label: '科技项目', value: '0', count: 0 },
        { label: '标准化', value: '1', count: 0 },
        { label: '示范工程', value: '2', count: 0 },
      ],
      resultTabList: [
        { label: '论文', value: '0', count: 0 },
        { label: '著作', value: '1', count: 0 },
        { label: '专利', value: '2', count: 0 },
        { label: '软件著作权', value: '3', count: 0 },
        { label: '获奖', value: '4', count: 0 },
        // {label: '标准', value: '5', count: 0},
        // {label: '人才', value: '6', count: 0},
        // {label: '微创新', value: '6', count: 0},
        { label: '工法', value: '7', count: 0 },
        { label: '其他', value: '8', count: 0 },
      ],
      visible: true,
      tabValue: '0',
      tabValue2: '0',
      deptOptions: [],
      locationOptions: [],
      profTitOptions: [],
      signatureFiles: [],
      formData: {
        otherExpertHonorary: '',
        // expertName: "",
        // phoneNumber: undefined,
        telephone: undefined,
        // sex: undefined,
        departmentId: null,
        majorName: '',
        secondMajor: undefined,
        classification: undefined,
        idCard: undefined,
        // duty: undefined,
        // profTitId: undefined,
        // profTit: undefined,
        performance: undefined,
        // education: undefined,
        // degree: undefined,
        degreeDate: undefined,
        educationDate: undefined,
        // school: undefined,
        degreeSchool: undefined,
        majorNowName: '',
        externalCo: undefined,
        coNature: undefined,
        coAddress: undefined,
        province: undefined,
        ioProvince: undefined,
        academicSuccess: undefined,
        expertCategory: undefined,
        expertHonorary: [],
        expertExpertise: [],
        recommendMajor: [],
        // birthDate: undefined,
        sysUser: {
          userName: '',
          nikeName: '',
          password: '',
          sex: '1',
          email: '',
          national: '',
          politicsStatus: '',
          birthDate: '',
          contactAds: '',
          postcode: '',
          phonenumber: '',
          departmentId: null,
          // outDepartName: '',
          majorName: '',
          majorNowName: '',
          idCard: '',
          duty: '',
          profTit: '',
          education: '',
          degree: '',
          school: '',
        },
        expertBank: {
          bankName: undefined,
          bankUsername: undefined,
          accountName: undefined,
          bankDetailName: undefined,
        },
        // expertCategorys: []
      },
    }
  },
  watch: {
    objId: {
      immediate: true,
      handler (val) {
        if (val) {
          this.getObj();
        }
      }
    },
  },
  created () {
    this.getKjxmList();
    this.getBzhList();
    this.getKjsfList();
    if (this.site_tag === 'jt') {
      this.tabList.push({ label: '微创新', value: '3', count: 0 })
      this.getWcxList();
    }
    this.getThesisList();
    this.getTreatiseList();
    this.getPatentList();
    this.getCopyrightList();
    this.getGfList();
    this.getOtherList();
    this.getAwardsList();

    this.getTreeselect();
    this.getProfTitTreeSelect();
  },
  methods: {
    getThesisList () {
      this.$api.cgzh.thesis.getJoinList({
        pageNum: 1,
        pageSize: 10,
        idCard: this.idCard
      }).then(response => {
        const index = this.resultTabList.findIndex((val) => val.value === '0')
        this.$set(this.resultTabList[index], 'count', response.total)
      }).catch((e) => {
        this.dataLoading = false;
        this.$message.error(e.toString());
      });
    },
    getTreatiseList () {
      this.$api.cgzh.treatise.getJoinList({
        pageNum: 1,
        pageSize: 10,
        idCard: this.idCard
      }).then(response => {
        const index = this.resultTabList.findIndex((val) => val.value === '1')
        this.$set(this.resultTabList[index], 'count', response.total)
      }).catch((e) => {
        this.dataLoading = false;
        this.$message.error(e.toString());
      });
    },
    getPatentList () {
      this.$api.cgzh.patent.getJoinList({
        pageNum: 1,
        pageSize: 10,
        idCard: this.idCard
      }).then(response => {
        const index = this.resultTabList.findIndex((val) => val.value === '2')
        this.$set(this.resultTabList[index], 'count', response.total)
      }).catch((e) => {
        this.dataLoading = false;
        this.$message.error(e.toString());
      });
    },
    getCopyrightList () {
      this.$api.cgzh.copyright.getJoinList({
        pageNum: 1,
        pageSize: 10,
        idCard: this.idCard
      }).then(response => {
        const index = this.resultTabList.findIndex((val) => val.value === '3')
        this.$set(this.resultTabList[index], 'count', response.total)
      }).catch((e) => {
        this.dataLoading = false;
        this.$message.error(e.toString());
      });
    },
    getAwardsList () {
      this.$api.cgzh.awards.getJoinList({
        pageNum: 1,
        pageSize: 10,
        idCard: this.idCard
      }).then(response => {
        const index = this.resultTabList.findIndex((val) => val.value === '4')
        this.$set(this.resultTabList[index], 'count', response.total)
      }).catch((e) => {
        this.dataLoading = false;
        this.$message.error(e.toString());
      });
    },
    getGfList () {
      this.$api.cgzh.gf.getJoinList({
        pageNum: 1,
        pageSize: 10,
        idCard: this.idCard
      }).then(response => {
        const index = this.resultTabList.findIndex((val) => val.value === '7')
        this.$set(this.resultTabList[index], 'count', response.total)
      }).catch((e) => {
        this.dataLoading = false;
        this.$message.error(e.toString());
      });
    },
    getOtherList () {
      this.$api.cgzh.other.getJoinList({
        pageNum: 1,
        pageSize: 10,
        idCard: this.idCard
      }).then(response => {
        const index = this.resultTabList.findIndex((val) => val.value === '8')
        this.$set(this.resultTabList[index], 'count', response.total)
      }).catch((e) => {
        this.dataLoading = false;
        this.$message.error(e.toString());
      });
    },

    getKjxmList () {
      this.$api.kjxm.project.myJoinList({
        pageNum: 1,
        pageSize: 10,
        idCard: this.idCard
      }).then(response => {
        this.$set(this.tabList[0], 'count', response.total)
      }).catch((e) => {
        this.dataLoading = false;
        this.$message.error(e.toString());
      });
    },
    getBzhList () {
      this.$api.bzh.standard.myJoinList({
        pageNum: 1,
        pageSize: 10,
        idCard: this.idCard
      }).then(response => {
        this.$set(this.tabList[1], 'count', response.total)
      }).catch(e => {
        this.dataLoading = false
        this.$message.error(e.toString())
      })
    },
    getKjsfList () {
      this.$api.kjsf.project.myJoinList({
        pageNum: 1,
        pageSize: 10,
        idCard: this.idCard
      }).then(response => {
        this.$set(this.tabList[2], 'count', response.total)
      }).catch(e => {
        this.dataLoading = false
        this.$message.error(e.toString())
      })
    },
    getWcxList () {
      this.$api.wcx.innovation.myJoinList({
        pageNum: 1,
        pageSize: 10,
        idCard: this.idCard
      }).then(
        (res) => {
          this.$set(this.tabList[3], 'count', response.total)
        }).catch((e) => {
          this.dataLoading = false;
          this.$message.error(e.toString());
        });
    },
    getObj () {
      this.$api.zjk.expert.get(this.objId).then(
        (res) => {
          this.formatData(res);
          getFiles(this.formData.sysUser.id).then((res) => {
            const files = {}
            res.data.forEach((item) => {
              if (!files[item.moduleKey]) {
                files[item.moduleKey] = []
              }
              files[item.moduleKey].push({
                name: item.fileName,
                url: item.fullFilePath,
                id: item.id,
                filePath: item.filePath
              })
            })
            // if (files.signature && files.signature.length > 1) {
            //   files.signature.reverse()
            // }
            this.signatureFiles = files.signature || []
            this.refreshStart = false;
          }).catch(e => {
            this.refreshStart = false;
            this.$message.error(e.toString())
          })
        }).catch((e) => {
          this.$message.error(e.toString());
        });
    },
    formatData (res) {
      // res.data.duty = res.data.duty.split(",").filter(item=> item !== '');
      res.data.expertHonorary = res.data.expertHonorary ? res.data.expertHonorary.split(",").filter(item => item !== '') : [];
      res.data.recommendMajor = res.data.recommendMajor ? res.data.recommendMajor.split(",").filter(item => item !== '') : [];
      res.data.expertExpertise = res.data.expertExpertise ? res.data.expertExpertise.split(",").filter(item => item !== '') : [];
      // 防止t-date-picker组件报错
      res.data.birthDate = res.data.birthDate ? res.data.birthDate : undefined;
      // 单位名称和单位所在地存储的是字符串导致filterByTree无法获取到值
      res.data.coAddress = res.data.coAddress ? Number(res.data.coAddress) : undefined;
      res.data.expertBank = res.data.expertBank ? res.data.expertBank : {}
      this.formData = res.data;
    },
    closeDialog () {
      this.$emit("update:visible", false);
    },
    getTreeselect () {
      this.$api.system.dept.treeSelectAll().then(response => {
        this.deptOptions = response.data;
      }).catch((e) => {
        this.$message.error(e.toString());
      });
      this.$api.system.location.treeselect().then(response => {
        this.locationOptions = response.data;
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    getProfTitTreeSelect () {
      return this.$api.system.profTit.highList().then(response => {
        // this.profTitOptions = response.data;
        this.profTitOptions = this.handleTree(response.data, "id");
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    handleExport () {
      this.$download(`/zjk/excel/getExpertReviewInfo/${this.objId}`, {}, `专家评审详情_${new Date().getTime()}.xls`)
    }
  },
}
</script>

<style lang="less" scoped>
.t-tab-panel {
  padding: 10px;
}

.tab-panel {
  height: calc(65vh - 64px);
  overflow: scroll;
}

/deep/ .t-badge--circle {
  position: relative;
}


/deep/ .t-radio.t-is-disabled .t-radio__input {
  background-color: unset;
}

/deep/ .t-radio.t-is-disabled .t-radio__label {
  color: unset
}

/deep/ .t-checkbox.t-is-disabled .t-checkbox__label {
  color: unset
}

.step-form {
  .t-row {
    align-items: stretch;

    .t-form__item {
      width: 100%;
    }

    .require {
      color: red;
      margin-right: 3px;
    }

    .t-col {
      border: 1px solid #ddd;
      color: #333;
      min-height: 37px;
      padding: 4px !important;
      overflow: hidden;
      display: flex;
      align-items: center;
      margin: 0px -1px -1px 0px;
    }

    .title {
      background-color: #FAFAFA;
      justify-content: flex-end;
      margin: 0px -1px -1px 0px;
      color: #606266;
    }
  }
}
</style>
